fix: repair failing tests and type errors across api and shared packages - #113
Open
stooit wants to merge 1 commit into
Open
fix: repair failing tests and type errors across api and shared packages#113stooit wants to merge 1 commit into
stooit wants to merge 1 commit into
Conversation
- shared: rename User.userName -> username to match consumers and tests - shared: implement paginate() utility (1-based paging, slice-based) - api/auth: fix HTTP method case (post -> POST) so POST /users is public - api/users: add missing badRequest import for 400 responses - tsconfig: add bun-types to compilerOptions.types for bun:test resolution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes all failing tests and TypeScript errors across the
apiandsharedpackages. Final state:bun test→ 22 pass / 0 fail;bunx tsc --noEmit→ exit 0.Changes
User.userName→usernameto align the shared type with its consumers and the test contract (was causing tsc errors inroutes/users.tsand the users tests).paginate()stub (previously threwnot implemented) — 1-based paging with slice-based windowing, correcttotal/totalPages, and emptydatafor out-of-range pages.post→POST) soPOST /usersis correctly treated as public (no token required).badRequestimport so 400 responses for missing fields resolve at runtime.bun-typestocompilerOptions.typesto resolve thebun:testmodule andprocessglobals (uses an already-present dependency; no new deps added).Verification
Assumptions
username, so the shared type was changed to match (rather than editing tests).bun:test/processtsc errors were a tsconfig wiring gap (missingbun-typesintypes), not a missing dependency — resolved via config only.Constraints honoured